home *** CD-ROM | disk | FTP | other *** search
- on CheckPods
- global theFirstPodChannel, theSecondPodChannel, theThirdPodChannel, theFourthPodChannel, theFirstBuildingChannel, theLastBuildingChannel, theBackgroundVelocity
- set theXVelocity to 2
- set theYVelocity to 2
- set podVelocity to theBackgroundVelocity / 2
- repeat with j = theFirstPodChannel to theFourthPodChannel
- if (the visible of sprite j = 1) and (the top of sprite j < (the stageBottom - the stageTop)) then
- set found to -1
- set oldXPos to the locH of sprite j
- repeat with h = theFirstBuildingChannel to theLastBuildingChannel
- if (j = theFirstPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 1") then
- set found to h
- end if
- if (j = theSecondPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 2") then
- set found to h
- end if
- if (j = theThirdPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 3") then
- set found to h
- end if
- if (j = theFourthPodChannel) and (the memberNum of sprite h = the number of member "Drop Off 4") then
- set found to h
- end if
- end repeat
- if found <> -1 then
- if (podVelocity < 0) and (the locH of sprite found < the locH of sprite j) and (the locH of sprite found < (the locH of sprite j + podVelocity)) then
- set the locH of sprite j to the locH of sprite j + podVelocity
- else
- if (podVelocity > 0) and (the locH of sprite found > the locH of sprite j) and (the locH of sprite found > (the locH of sprite j + podVelocity)) then
- set the locH of sprite j to the locH of sprite j + podVelocity
- end if
- end if
- if (the locH of sprite found < (the locH of sprite j - theXVelocity)) and (the locH of sprite found < the locH of sprite j) then
- set the locH of sprite j to the locH of sprite j - theXVelocity
- else
- if (the locH of sprite found >= (the locH of sprite j + theXVelocity)) and (the locH of sprite found >= the locH of sprite j) then
- set the locH of sprite j to the locH of sprite j + theXVelocity
- end if
- end if
- else
- set the locH of sprite j to the locH of sprite j + podVelocity
- if podVelocity > 0 then
- set the locH of sprite j to the locH of sprite j + theXVelocity
- else
- if podVelocity < 0 then
- set the locH of sprite j to the locH of sprite j - theXVelocity
- end if
- end if
- end if
- set yDiff to sqrt(abs(oldXPos - the locH of sprite j))
- if yDiff <= 0 then
- set yDiff to 1
- end if
- set the locV of sprite j to the locV of sprite j + yDiff
- end if
- end repeat
- end
-